<?php

$iBreadCrumb = count($aBreadCrumb);

$aCrumbs = array();

if ($iBreadCrumb > 0)
{
	$iBreadCrumb--;
	
	for ($i = $iBreadCrumb; $i >= 0; $i--)
	{
		$sHref = '/'.$aBreadCrumb[$i]->page_name;
		
		if ($aBreadCrumb[$i]->page_name === null)
		{
			$sHref = '/';
		}
		
		if ($sHref === '//')
		{
			$sHref = '/';
		}
		
		$aCrumbs[] = '<span class="'.($i === 0 ? 'endLink' : 'link').'"><a href="'.$sHref.'">'.$aBreadCrumb[$i]->page_menu_title.'</a></span>';
	}
}

echo implode(" &gt; ", $aCrumbs);
?>
